import request from '@/utils/request'

// 获取部门数据
export const getDepartments = function() {
  return request({
    url: '/company/department'
  })
}

// 删除部门
export const delDepartment = function(id) {
  return request({
    method: 'delete',
    url: '/company/department/' + id
  })
}

// 新增部门
export const addDepartment = function(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 获取单个部门信息
export const getDepartmentDetails = function(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 修改部门信息
export const editDepartment = function(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
